package com.xlk.restful.client;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;

import com.xlk.restful.domain.Category;
import com.xlk.restful.service.impl.CategoryService;


/**
 * 
 * 启动restful服务 </br> 
 * 类名: CategoryServerStart </br> 
 * 日期: 2014-2-25 下午02:25:30 </br> 
 * @author 许立亢 
 * @version 1.0
 */
public class CategoryServerStart {

	public static void main(String[] args) {

		// Service instance

		CategoryService categoryService = new CategoryService();
		JAXRSServerFactoryBean restServer = new JAXRSServerFactoryBean();


		restServer.setResourceClasses(Category.class);

		restServer.setServiceBean(categoryService);

		restServer.setAddress("http://localhost:9000/");

		restServer.create();

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {
			br.readLine();
		} catch (IOException e) {

		}
		System.out.println("Server Stopped");
		System.exit(0);

	}

}
